<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 创建类
        class Star {
            constructor(name, age) {
                this.name = name;
                this.age = age;
            }
        };
        // 创建对象
        var ldh = new star("刘德华", 50);
        console.log(ldh.name);
        var gfc = new star("郭富城", 51);
        console.log(gfc.name);
    </script>
</body>

</html>